home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- /* format expected is one cookie per 'line', with @ representing an embedded \n */
- void main(int argc, char * argv[])
- {
- int c;
- char *title;
-
- if (argc < 2)
- title = "BIX";
- else
- title = argv[1];
-
- c = getchar();
- while (c != EOF) {
- c = getchar();
- printf("#%s%%", title); /* cookie title */
- while ((c != EOF) && (c != '\n')) {
- /* write cookie */
- if (c == '@')
- printf("\n ");
- else
- putchar(c);
- c = getchar();
- }
- putchar('\n');
- }
-
- printf("##\n"); /* end */
- }